<template>
  <div class="count1">
    <input type="text" ref = "ipt">
    <button @click = "getIpt">拿到输入框中的值</button>
    <h1>{{count}}</h1>
  </div>
</template>

<script>
export default {
  //名字
  name: "Count1",
  //数据
  data() {
    return{
        count: ""
    }
  },
  //函数
  methods:{
    getIpt(){
        //拿到输入框的值
        const value = this.$refs.ipt.value
        
        //保存到数据
        this.count = value
    }
  }
};
</script>

<style>
.count1 {
  background-color: aqua;
  height: 200px;
}
</style>